package ThreadDemo;

public class RunnableTest {

    public static void main(String[] args) {
        for (int j = 0; j < 300; j++) {
            System.out.println(Thread.currentThread().getName() + " " + j);
            if (j == 20) {
                SecondThread secondThread = new SecondThread();
                Thread t1 = new Thread(secondThread,"线程1");
                Thread t2 = new Thread(secondThread,"线程2");
                t1.start();
                t2.start();
            }
        }
    }
}
